package com.dong.applicationcontext.event;

import org.springframework.context.ApplicationListener;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.Async;

/**
 * description
 *
 * @author Administrator 2021/09/06 20:20
 */
public class BlockedListNotifier implements ApplicationListener<BlockedListEvent> {

    private String notificationAddress;

    public void setNotificationAddress(String notificationAddress) {
        this.notificationAddress = notificationAddress;
    }

    @EventListener
    @Order(22)
    public void processBlockedListEvent(BlockedListEvent blockedListEvent){
        System.out.println("基于注解的监听者");
    }

    public void createdUser(){

    }

    @Override
    public void onApplicationEvent(BlockedListEvent blockedListEvent) {
        System.out.println("接收到事件");
    }
}
